package com.yisu.expressway.utils;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;

import com.yisu.expressway.R;
import com.yisu.expressway.settings.AppConstant;
import com.yisu.expressway.ui.MultiButtonDialog;

/**
 * Created by Administrator on 2017/1/4 0004.
 */

public class PhoneCallUtils {

    public static void makePhoneCall(final Activity activity,String phoneNumber){
        final MultiButtonDialog dialog = new MultiButtonDialog(activity);
        dialog.show();
        StringBuilder title = new StringBuilder(activity.getString(R.string.make_phone_call));
        title.append(" ").append(phoneNumber);
        dialog.setContentText(title.toString());
        dialog.setPositiveClickListener(new MultiButtonDialog.PositiveClickListener() {
            @Override
            public void onPositiveClick(String inputContent) {
                dialog.dismiss();
                Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + AppConstant.HIGH_WAY_RESCUE_NUMBER));
                activity.startActivity(intent);
            }
        });
    }
}
